﻿using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.WorksheetElements
{
    [XmlRoot("mergeCells", Namespace = Constants.ExcelMain)]
    public class MergeCells : XmlSerializable
    {
        [Optional]
        [XmlAttribute("count", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> Count { get; set; }

        [XmlElement("mergeCell", Namespace = Constants.ExcelMain)]
        public XmlList<MergeCell> MergedCells { get; set; }

        public MergeCells()
        {
            MergedCells = new XmlList<MergeCell>();
        }
    }

    [XmlRoot("mergeCell", Namespace = Constants.ExcelMain)]
    public class MergeCell : XmlSerializable
    {
        [Optional]
        [XmlAttribute("ref", Form = XmlSchemaForm.Qualified)]
        public string Reference { get; set; }

        public MergeCell() { }
    }
}
